package com.school.movie.common.utils;

/**
 * @author zhaoren
 */
public class CollectionUtils {

    public static final double LOAD_FACTORY = 0.75d;

    public static int getHashMapCapacity(int size) {
        for (int i = 0, cur = 2; ; i++) {
            cur = (int) Math.pow(2, i);
            if (cur * LOAD_FACTORY >= size) {
                return cur;
            }
        }
    }

}
